#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    ListNode* swapPairs(ListNode* head) {
        if (head == nullptr || head->next == nullptr)
        {
            return head;
        }

        ListNode* tmp = swapPairs(head->next->next);
        ListNode* res = head->next;
        head->next->next = head;
        head->next = tmp;
        return res;

    }
};